HELLO, here's a list of all the todo / notes that i might or might not fix / implement
:D


----------- TODO?

-fix / refine completionist mode

-tuning for log making, more stats for completionist sign:
    Character: Wigfrid
    Task duration: 60
    Task 1: Hit Pengull (with 30s left)
    Task 2: Eat anything (with 1s left)
    Task 3: Stand next to Pickaxe (with 17s left)
    etc. etc.

-"pick up a" doesn't work if you pick up item and inv is full (goes to mouse), or if you put it in inventory with mouse in that situation.
(you must drop and pick it up with space in inv / container.)

-fix some items not having a / an (example: Craft Compass)
(note: RN completely ignoring the a / an)

-sound when you finish a task?



----------- NOTES:

-for now, one task is Craft / Build a. could check for deployable and have it say "Craft" or "Build" only
-for now, one task is Kill / Destroy a. could check for something and have it say "Kill" or "Destroy" only

-we're missing: crow, robin, robin_winter, mooseegg, 

-sometimes tasks can trigger b2b. eg you roll hit koalefant_winter, if next one is koalefant_summer, it completes instantly. rare though.

-can't kill: (maybe we can check if they have an OnDeath?)
tentacle_garden, (rn excluding, are there others?)

-unsure about pigtrader; looks the same as a pig... 
(note: rn excluding!)

-do we wanna disable pigguard? or at least check if one even exists... (exists in adventure mode; maybe keep it in...)

-maxwellhead not always visible... and he says "1 tasks". remove the s.

-could add the pig names to CharlieSays. search for "for any specials"


    HAM PIG NAMES: (could normalize: both banker and banker_shopkeep would be Banker)
    -- pigman_mayor, pigman_mayor_shopkeep
    -- pigman_queen,
    pigman_erudite, pigman_erudite_shopkeep,
    pigman_usher,
    pigman_professor, pigman_professor_shopkeep,

    pigman_storeowner, pigman_storeowner_shopkeep,
    pigman_florist, pigman_florist_shopkeep,
    pigman_farmer, pigman_farmer_shopkeep, 
    pigman_hunter, pigman_hunter_shopkeep,
    pigman_hatmaker, pigman_hatmaker_shopkeep,
    pigman_collector, pigman_collector_shopkeep, 

    pigman_shopkeep,
    pigman_banker, pigman_banker_shopkeep

    pigman_beautician, pigman_beautician_shopkeep,
    pigman_mechanic, pigman_mechanic_shopkeep,
    pigman_miner, pigman_miner_shopkeep, 
    pigman_royalguard, pigman_royalguard_2, 

    PIGMAN NAMES:
    "Aemilian",    "Alex",    "Alia",    "Am",    "Anatasius",    "Anthemius",    "Antonius",    "Apple",
    "Arcadius",    "Augustus",    "Aurelian",    "Avitus",    "Bacon",    "Bagel",    "Balbinus",    "Barley",    "Basiliscus",
    "Berry",    "Biscuit",    "Brook",    "Brownie",    "Bryce",    "Bug",    "Butters",    "Cabbage",    "Caligula",    "Caracalla",    "Carinus",    "Carus",    "Cheddar",    "Cheeky Chris",
    "Chip",    "Claudius",    "Clover",    "Coco",    "Commodus",    "Constans",    "Constantine",    "Constantius",    "Corey",    "Crabby",    "Custard",    "Didius",    "Diocletian",    "Domitian",
    "Doughnut",    "Dumpling",    "Eggbert",    "Eggy",    "Elagabalus",    "Eugene",    "Florian",    "Galba",    "Galerius",    "Gallienus",    "Geta",    "Glycerius",    "Gordian",    "Gouda",    "Graham",
    "Gratian",    "Hadrian",    "Hamilton",    "Hamms",    "Honorius",    "Hostilian",    "Hugo",    "Itchy Chris",    "Ian",    "Itchy Chris",    "It",    "Jamie",    "Jack-O-Lantern",    "Jeff",    "Jerky",
    "Joannes",    "Joe",    "Jovian",    "Julian",    "Ju-lian",    "Julius",    "Justin",    "Justinian",    "Kelly",    "Kevin",    "Kiwi",    "Leo",    "Libius",
    "Licinius",    "Lucius",    "Majorian",    "Marcian",    "Marcrinus",    "Marcus",    "Matt",    "Maurice",    "Maxentius",    "Maximian",    "Maximinus",    "Mickey",
    "Moon Pie",    "Mr.P",    "Nacho",    "Nero",    "Nerva",    "Numerian",    "Oatey",    "Oinkey",    "Olive",    "Olybrius",    "Otho",    "Pasta",    "Pepper",    "Pertinax",
    "Petronius",    "Philip",    "Pickles",    "Pizza",    "Porkbun",    "Porkins",    "Porky",    "Probus",    "Puffin",    "Pumpkin",    "Pupienus",    "Quintillus",
    "Quarter Pounder",    "Reuben",    "Romulus",    "Salty",    "Septmius",    "September",    "Seth",    "Severus",    "Smelly",    "Tacitus",    "Tater",    "Tatham",
    "Theodosius",    "Tiberius",    "Titus",    "Trajan",    "Trebonianus",    "Truffle",    "Tuna",    "Twinkie",    "Valens",    "Valentinian",    "Valerian",
    "Vespasian",    "Vetriano",    "Vitellius",    "Waffle",    "Water",    "Weiner",    "Wiggles",    "Wonder Bread",    "Xavier",    "Yo-yo",    "Zeno",





CODEWORDS: (to find bits of code easily lol...)
code: "fxd" in charliesays


            -- -- We will do Build a later on...
            -- elseif randomTask == "Deploy / Place a" then
            --     self.eventListener = function(inst, data)
            --         if (data and data.item and data.item.prefab == prefabname) or
            --         (data.prefab == prefabname) then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("buildstructure", self.eventListener)


---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------



                -- -- we could do fixed tasks like this so it's not impossible.
                -- -- or above, but exclude some items...

            -- local taskNames = {
            --     "Eat anything", "Eat a Dragonpie",
            --     "Equip an Opulent Pickaxe",
            --     "Craft a Spear", "Build a Chest", 
            --     "Pick up a Gold Nugget",                
            --     "Kill a Spider", "Hit a Beefalo",
            --     "Touch a Fire Pit",
            -- }

            -- --local randomTask = taskNames[math.random(1, #taskNames)]
            -- local randomTask = taskNames[#taskNames] -- Debug only latest

            -- -- Attach event listener
            -- if randomTask == "Eat anything" then
            --     self.eventListener = function(inst, data)
            --         self:MarkAsCompleted()
            --     end
            --     GetPlayer():ListenForEvent("oneatsomething", self.eventListener)

            -- elseif randomTask == "Eat a Dragonpie" then
            --     self.eventListener = function(inst, data)
            --         if data and data.food and data.food.prefab == "dragonpie" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("oneatsomething", self.eventListener)

            -- elseif randomTask == "Equip an Opulent Pickaxe" then
            --     self.eventListener = function(inst, data)
            --         if data and data.item and data.item.prefab == "goldenpickaxe" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("equip", self.eventListener)

            -- elseif randomTask == "Craft a Spear" then
            --     self.eventListener = function(inst, data)
            --         if data and data.item and data.item.prefab == "spear" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("builditem", self.eventListener)

            -- elseif randomTask == "Build a Chest" then
            --     self.eventListener = function(inst, data)
            --         if data and data.item and data.item.prefab == "treasurechest" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("buildstructure", self.eventListener)

            -- elseif randomTask == "Pick up a Gold Nugget" then
            --     self.eventListener = function(inst, data)
            --         if data and data.item and data.item.prefab == "goldnugget" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("gotnewitem", self.eventListener)
            --     GetPlayer():ListenForEvent("containergotitem", self.eventListener)
            --     -- maybe check if failed, as in if it's on our cursor? or dropped to the ground?
            
            -- elseif randomTask == "Kill a Spider" then
            --     self.eventListener = function(inst, data)
            --         if data and data.victim and data.victim.prefab == "spider" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("killed", self.eventListener)
                
            -- elseif randomTask == "Hit a Beefalo" then
            --     self.eventListener = function(inst, data)
            --         if data and data.target and data.target.prefab == "beefalo" then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("onattackother", self.eventListener)

            -- elseif randomTask == "Touch a Fire Pit" then
            --     self.periodicTask = GetPlayer():DoPeriodicTask(0.33, function() -- 0.33 ok? was 0.5
                    
            --         local nearestEntity = FindEntity(GetPlayer(), 1.5, function(guy)
            --             return (guy:IsValid() and not guy:HasTag("INTERIOR_LIMBO") and not guy:HasTag("player") and not guy:HasTag("FX") and
            --             guy.prefab == "firepit")
            --         end)

            --         if nearestEntity then
            --             self:MarkAsCompleted()
            --         end
            --     end)





















                        -- -- backup that only checks prefab
            -- elseif randomTask == "Kill / Destroy a" then
            --     self.eventListener = function(inst, data)
            --         if data and data.victim and data.victim.prefab == prefabname then
            --             self:MarkAsCompleted()
            --         end
            --     end
            --     GetPlayer():ListenForEvent("killed", self.eventListener)

















                        -- elseif prefabname == "pigman_royalguard" then -- RN have different guards
            --     displayname = "Royal Guard (Pig City)"
            --     forceUsePrefabName = true
            -- elseif prefabname == "pigman_royalguard_2" then -- RN have different guards
            --     displayname = "Royal Guard (Palace)"
                -- forceUsePrefabName = true











code: dply in charliesays
---------
            -- elseif randomTask == "Deploy / Place a" then
            --     local randomPrefab = allSafePrefabs.getRandomPrefabNameWithComponentOrTag("deployable", {})

            --     if randomPrefab ~= nil then
            --         local spawned_ent = SpawnPrefab(randomPrefab)
            --         if spawned_ent and spawned_ent:IsValid() then
            --             prefabname = spawned_ent.prefab
            --             displayname = spawned_ent:GetDisplayName() -- convert to displayname

                        -- -- Check if displayname maps to multiple prefabs
                        -- if displaynameToPrefabs[displayname] then
                        --     possiblePrefabs = displaynameToPrefabs[displayname]
                        -- else
                        --     possiblePrefabs = { prefabname } -- Default to just this prefab
                        -- end
            --         end                    

            --         if string.match(displayname:lower(), "^[aeiou]") then -- starts with a vowel
            --             taskName = "Deploy / Place an"
            --         end

            --         if string.match(displayname:lower(), "s$") then -- ends in an s
            --             taskName = "Deploy / Place"
            --         end

            --         taskName = taskName .. " " .. displayname

            --         if spawned_ent and spawned_ent:IsValid() then
            --             spawned_ent:Remove()
            --         end
            --     else
            --         print("No randomPrefab, now what . . ?")
            --     end   







if you wanna put (item) at the end:
                        -- -- where to put this? NVM not using anymore.
                        -- -- was using to mark any inventory items with (item).
                        -- if prefabname:find("_item") then
                        --     displayname = displayname .. " (item)"
                        -- end



